//
//  MJStudent.m
//  MJExtensionExample
//
//  Created by MJ Lee on 15/1/5.
//  Copyright (c) 2015年 小码哥. All rights reserved.
//

#import "MJStudent.h"
#import "MJBook.h"

@implementation MJStudent

//模型中的属性名和字典中的key不相同（字典转化为模型时使用）
+ (NSDictionary *)mj_replacedKeyFromPropertyName {
    return @{@"ID" : @"id",
             @"desc" : @"desciption",
             @"oldName" : @"name.oldName",
             @"nowName" : @"name.newName",
             @"nameChangedTime" : @"name.info[1].nameChangedTime",
             @"bag" : @"other.bag"
             };
}

-(void)description {
    NSLog(@"ID=%@, otherName=%@, nowName=%@, oldName=%@, nameChangedTime=%@, desc=%@",
          _ID, _otherName, _nowName,  _oldName, _nameChangedTime, _desc);
    
    [_bag description];
    
    for (MJBook *book in _books) {
        [book description];
    }
}

@end
